package com.ys.nms.module.business.dal.mysql.linksManual;

import java.util.*;

import com.ys.nms.framework.common.pojo.PageResult;
import com.ys.nms.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.ys.nms.framework.mybatis.core.mapper.BaseMapperX;
import com.ys.nms.module.business.dal.dataobject.linksManual.LinksManualDO;
import org.apache.ibatis.annotations.Mapper;
import com.ys.nms.module.business.controller.admin.linksManual.vo.*;

/**
 * 线路-手动 Mapper
 *
 * @author zzy
 */
@Mapper
public interface LinksManualMapper extends BaseMapperX<LinksManualDO> {

    default PageResult<LinksManualDO> selectPage(LinksManualPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LinksManualDO>()
                .eqIfPresent(LinksManualDO::getLocalPortId, reqVO.getLocalPortId())
                .eqIfPresent(LinksManualDO::getLocalDeviceId, reqVO.getLocalDeviceId())
                .eqIfPresent(LinksManualDO::getRemotePortId, reqVO.getRemotePortId())
                .eqIfPresent(LinksManualDO::getActive, reqVO.getActive())
                .eqIfPresent(LinksManualDO::getProtocol, reqVO.getProtocol())
                .likeIfPresent(LinksManualDO::getRemoteHostname, reqVO.getRemoteHostname())
                .eqIfPresent(LinksManualDO::getRemoteDeviceId, reqVO.getRemoteDeviceId())
                .eqIfPresent(LinksManualDO::getRemotePort, reqVO.getRemotePort())
                .eqIfPresent(LinksManualDO::getRemotePlatform, reqVO.getRemotePlatform())
                .eqIfPresent(LinksManualDO::getRemoteVersion, reqVO.getRemoteVersion())
                .eqIfPresent(LinksManualDO::getManual, reqVO.getManual())
                .eqIfPresent(LinksManualDO::getIsCritical, reqVO.getIsCritical())
                .likeIfPresent(LinksManualDO::getSysname, reqVO.getSysname())
                .eqIfPresent(LinksManualDO::getBoardId, reqVO.getBoardId())
                .orderByDesc(LinksManualDO::getId));
    }

}